package top.twoteam.equipment.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.twoteam.equipment.entity.EquipmentImage;
import top.twoteam.equipment.mapper.EquipmentImageMapper;
import top.twoteam.equipment.service.EquipmentImageService;

import java.util.List;

@Service
public class EquipmentImageServiceImpl implements EquipmentImageService {

    @Autowired
    EquipmentImageMapper equipmentImageMapper;

    /**
     * 添加照片
     * @param equipmentImage
     * @return
     */
    @Override
    public Integer uploadImage(EquipmentImage equipmentImage) {
        int code = equipmentImageMapper.insert(equipmentImage);
        return code;
    }


    /**
     * 根据eqid获取图片
     * @param eqId
     * @return
     */
    @Override
    public List<EquipmentImage> getImageByEqid(int eqId) {
        List<EquipmentImage> imgByEqid = equipmentImageMapper.getImgByEqid(eqId);
        return imgByEqid;
    }
}
